package cn.langpy.recall.core;


import cn.langpy.recall.common.ChatRecord;
import cn.langpy.recall.common.KnownRecord;
import cn.langpy.recall.common.MemorySpace;
import cn.langpy.recall.common.Response;

import java.util.List;

/**
 * AI记忆操作的核心接口
 * @author zhangchang
 */
public interface Recall {
    /**
     * 添加对话记录
     */
    Response add(ChatRecord record);

    /**
     * 添加知识记录
     * @param record
     * @return
     */
    Response add(KnownRecord record);

    /**
     * 查询对话记忆
     * @return
     */
    Response call(ChatRecord record);

    /**
     * 查询知识库的内容
     * 知识库=add(KnownRecord record)+对话中提取的知识
     * @param record
     * @return
     */
    Response call(KnownRecord record);

    /**
     * 是否存在记忆空间
     * @param memorySpace
     * @return
     */
    boolean existsMemorySpace(String memorySpace);

    /**
     * 删除记忆空间
     * @param memorySpace
     * @return
     */
    boolean deleteMemorySpace(String memorySpace);

    /**
     * 创建记忆空间
     * @param memorySpace
     * @return
     */
    boolean createMemorySpace(String memorySpace);

    List<MemorySpace> listMemorySpaces();
}
